package com.example.javanewwork.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.javanewwork.entity.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {


    @Select("select * from orders")
    List<Order> findall();



    @Delete("delete from orders where id = #{id}")
    void deleteByid(int id);

    @Update("update orders set buyer=#{buyer},deviceName=#{deviceName},count = #{count}," +
            "totalPrice=#{totalPrice} where id = #{id}")
    void modify(int id, String buyer, String deviceName, int count, String totalPrice);

    @Insert("insert into orders(buyer,deviceName,count,totalPrice) VALUES (#{buyer},#{deviceName},#{count},#{totalPrice})")
    void add(String buyer, String deviceName, int count, String totalPrice);
}
